package day10_io_code.com.itheima.d1_char_stream;

import java.io.FileWriter;

public class FileWriteDemo3 {
    public static void main(String[] args) {
        try (
                FileWriter fw = new FileWriter("d:\\demo\\c.txt", true);
        ) {
            fw.write(97);
            fw.write('磊');
            fw.write("\r\n");

            fw.write("我爱你");
            fw.write("\r\n");

            fw.write("中国", 1, 1);
            fw.write("\r\n");

            char[] chars = "abc我爱你中国".toCharArray();
            fw.write(chars);
            fw.write("\r\n");

            fw.write(chars, 3, 5);
            fw.write("\r\n");

            fw.flush();
            fw.close();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
